{
 "cells": [
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-01-08T08:12:20.830270Z",
     "start_time": "2025-01-08T08:12:20.821688Z"
    }
   },
   "cell_type": "code",
   "source": "print(\"hello w66orld\")",
   "id": "1c40c076c6eb2b09",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hello w66orld\n"
     ]
    }
   ],
   "execution_count": 3
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-01-08T08:29:13.591377Z",
     "start_time": "2025-01-08T08:29:11.220637Z"
    }
   },
   "cell_type": "code",
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import torch\n",
    "import torch.nn as nn\n",
    "import torch.optim as optim\n",
    "from sklearn.metrics import mean_squared_error, mean_absolute_error\n",
    "import matplotlib.pyplot as plt\n",
    "from torch.utils.data import TensorDataset, DataLoader\n",
    "\n",
    "\n",
    "# 检查是否有可用的 GPU 设备\n",
    "device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n",
    "print(f\"使用的设备: {device}\")\n",
    "print(\"开始训练...\")\n",
    "\n",
    "# 读取数据\n",
    "file_path = 'C:\\\\Users\\\\严如梦\\\\Desktop\\\\文献2023\\\\康缘\\\\其他\\\\300701\\\\副本T3007A.xlsx'\n",
    "sheet_name = 'Sheet2'\n",
    "data = pd.read_excel(file_path, sheet_name=sheet_name)\n",
    "\n",
    "# 特征提取，提取从第三列到倒数第二列的所有列名作为特征列\n",
    "feature_columns = data.columns[2:-1]\n",
    "batch1 = data[(data.iloc[:, 1] == 'Z241028-1')].iloc[0:382]\n",
    "batch2 = data[(data.iloc[:, 1] == 'Z241029-1')].iloc[426:817]\n",
    "# 左闭右开区间，所以它包含索引 424 到 814 的行。\n",
    "\n",
    "# 打印 batch1 和 batch2 的数据\n",
    "print(\"Batch 1 Data:\")\n",
    "print(batch1)\n",
    "print(\"\\nBatch 2 Data:\")\n",
    "print(batch2)"
   ],
   "id": "7ab8c96ae40a961d",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "使用的设备: cuda\n",
      "开始训练...\n",
      "Batch 1 Data:\n",
      "                    time      batch  outall  outspeed  outtemp  temperature2  \\\n",
      "0    2024-10-29 11:17:00  Z241028-1     0.0       1.0   41.985        46.875   \n",
      "1    2024-10-29 11:18:00  Z241028-1     0.0       1.0   48.843        52.054   \n",
      "2    2024-10-29 11:19:00  Z241028-1     0.0       1.0   51.360        68.721   \n",
      "3    2024-10-29 11:20:00  Z241028-1     0.0       1.0   54.688        84.288   \n",
      "4    2024-10-29 11:21:00  Z241028-1     0.0       1.0   58.478        92.766   \n",
      "..                   ...        ...     ...       ...      ...           ...   \n",
      "377  2024-10-29 17:34:00  Z241028-1     0.0       1.0   45.284        71.412   \n",
      "378  2024-10-29 17:35:00  Z241028-1     0.0       1.0   44.821        73.293   \n",
      "379  2024-10-29 17:36:00  Z241028-1     0.0       1.0   44.300        67.679   \n",
      "380  2024-10-29 17:37:00  Z241028-1     0.0       1.0   44.705        67.708   \n",
      "381  2024-10-29 17:38:00  Z241028-1     0.0       1.0   45.602        69.618   \n",
      "\n",
      "     pressure2  inspeed  temperature3  pressure3  temperature  pressure  \\\n",
      "0       -0.057    4.389        29.890     -0.073       70.370    -0.052   \n",
      "1       -0.053    4.059        32.870     -0.075       80.136    -0.050   \n",
      "2       -0.039    3.931        35.185     -0.076       87.008    -0.034   \n",
      "3       -0.024    3.774        39.005     -0.077       92.940    -0.018   \n",
      "4       -0.024    3.823        44.473     -0.067       97.859    -0.008   \n",
      "..         ...      ...           ...        ...          ...       ...   \n",
      "377     -0.064    0.014        43.056     -0.094       84.332    -0.043   \n",
      "378     -0.067    2.066        42.072     -0.095       82.451    -0.059   \n",
      "379     -0.075    0.014        45.862     -0.092       83.030    -0.049   \n",
      "380     -0.072    0.014        45.833     -0.093       85.272    -0.044   \n",
      "381     -0.070    9.677        44.502     -0.094       87.225    -0.046   \n",
      "\n",
      "     steampressure  density  \n",
      "0            0.394    0.783  \n",
      "1            0.443    0.791  \n",
      "2            0.482    0.790  \n",
      "3            0.490    0.788  \n",
      "4            0.492    0.787  \n",
      "..             ...      ...  \n",
      "377          0.525    0.870  \n",
      "378          0.521    0.864  \n",
      "379          0.524    0.862  \n",
      "380          0.532    0.875  \n",
      "381          0.529    0.880  \n",
      "\n",
      "[382 rows x 14 columns]\n",
      "\n",
      "Batch 2 Data:\n",
      "                    time      batch  outall  outspeed  outtemp  temperature2  \\\n",
      "850  2024-10-30 03:03:00  Z241029-1   0.517     0.137   43.027        60.822   \n",
      "851  2024-10-30 03:04:00  Z241029-1   0.519     0.107   42.303        60.388   \n",
      "852  2024-10-30 03:05:00  Z241029-1   0.521     0.098   41.580        60.012   \n",
      "853  2024-10-30 03:06:00  Z241029-1   0.522     0.075   40.943        59.693   \n",
      "854  2024-10-30 03:07:00  Z241029-1   0.524     0.073   40.278        59.317   \n",
      "855  2024-10-30 03:08:00  Z241029-1   0.525     0.065   39.670        58.999   \n",
      "856  2024-10-30 03:09:00  Z241029-1   0.526     0.071   39.120        58.652   \n",
      "857  2024-10-30 03:10:00  Z241029-1   0.527     0.063   38.600        58.304   \n",
      "858  2024-10-30 03:11:00  Z241029-1   0.528     0.054   38.108        58.015   \n",
      "859  2024-10-30 03:12:00  Z241029-1   0.529     0.067   37.674        57.726   \n",
      "860  2024-10-30 03:13:00  Z241029-1   0.530     0.047   37.326        57.465   \n",
      "861  2024-10-30 03:14:00  Z241029-1   0.531     0.053   36.950        57.176   \n",
      "862  2024-10-30 03:15:00  Z241029-1   0.532     0.037   36.690        56.944   \n",
      "863  2024-10-30 03:16:00  Z241029-1   0.533     0.061   36.400        56.742   \n",
      "864  2024-10-30 03:17:00  Z241029-1   0.534     0.056   36.140        56.453   \n",
      "865  2024-10-30 03:18:00  Z241029-1   0.535     0.054   35.880        56.279   \n",
      "\n",
      "     pressure2  inspeed  temperature3  pressure3  temperature  pressure  \\\n",
      "850     -0.008    0.014        40.249     -0.008       68.345    -0.009   \n",
      "851     -0.008    0.014        40.046     -0.009       67.911    -0.009   \n",
      "852     -0.008    0.014        39.844     -0.009       67.622    -0.010   \n",
      "853     -0.009    0.014        39.641     -0.010       67.332    -0.010   \n",
      "854     -0.009    0.014        39.468     -0.010       66.898    -0.010   \n",
      "855     -0.009    0.014        39.323     -0.011       66.536    -0.011   \n",
      "856     -0.010    0.014        39.149     -0.011       66.175    -0.011   \n",
      "857     -0.010    0.014        39.034     -0.011       65.885    -0.012   \n",
      "858     -0.011    0.014        38.889     -0.012       65.524    -0.012   \n",
      "859     -0.011    0.014        38.715     -0.012       65.307    -0.012   \n",
      "860     -0.011    0.014        38.600     -0.012       65.017    -0.013   \n",
      "861     -0.012    0.014        38.426     -0.013       64.728    -0.013   \n",
      "862     -0.012    0.014        38.281     -0.013       64.439    -0.013   \n",
      "863     -0.012    0.014        38.194     -0.014       64.222    -0.014   \n",
      "864     -0.013    0.014        38.050     -0.014       63.932    -0.014   \n",
      "865     -0.013    0.014        37.934     -0.014       63.643    -0.014   \n",
      "\n",
      "     steampressure  density  \n",
      "850            0.0      0.5  \n",
      "851            0.0      0.5  \n",
      "852            0.0      0.5  \n",
      "853            0.0      0.5  \n",
      "854            0.0      0.5  \n",
      "855            0.0      0.5  \n",
      "856            0.0      0.5  \n",
      "857            0.0      0.5  \n",
      "858            0.0      0.5  \n",
      "859            0.0      0.5  \n",
      "860            0.0      0.5  \n",
      "861            0.0      0.5  \n",
      "862            0.0      0.5  \n",
      "863            0.0      0.5  \n",
      "864            0.0      0.5  \n",
      "865            0.0      0.5  \n"
     ]
    }
   ],
   "execution_count": 6
  },
  {
   "metadata": {},
   "cell_type": "code",
   "outputs": [],
   "execution_count": null,
   "source": "",
   "id": "d953038b82945a40"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "pytorch",
   "language": "python",
   "name": "pytorch"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
